﻿using Besture.Common;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Besture.Bll;
using Besture.Common.Helper;
using Besture.Model;
using Besture.UI.Common;

namespace Besture.UI.Portal.UserCenter
{
    public partial class HotelCommentList : UserPage
    {
        public String sNickName = string.Empty;
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        /// <summary>
        /// 保存功能
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void BtnSaveClick(object sender, EventArgs e)
        { 
            var dac = new AppraisalDac();
            AppraisalModel model = null;
            var baseDac = new BaseDac<AppraisalModel>();
            model = new AppraisalModel
            {
                HotelsID = Convert.ToInt32(StringHelper.Query("hId")),
                UserID = GetUserLoginModel().ID,
                Content = txtContent.Value.Trim(),
                AppraisalTime =DateTime.Now,
                Location = Convert.ToInt32(hidLocation.Value.Trim()),
                Facilities = Convert.ToInt32(hidFacilities.Value.Trim()),
                Service = Convert.ToInt32(hidService.Value.Trim()),
                Health = Convert.ToInt32(hidHealth.Value.Trim()),
                CheckStatus = Constants.USER_CHECK_CHECKING,//点评审核中
                SortID = Convert.ToInt32(SortService.GetSortID("TBAppraisal", false))
            };
            //加载添加基本数据
            baseDac.LoadAddBaseModel(model);
            if (dac.Add(model)> 0)
                FunHelper.Alert("保存成功", "/Portal/UserCenter/OrderList.aspx");
            else
                FunHelper.Alert("保存失败");
        }
    }
}